/**
 * 
 */
package de.mbenning.fsim.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * @author Martin.Benning
 *
 */
@Entity
@Table (name  = "PERSON")
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class Person implements Serializable {

	private static final long serialVersionUID = 6920716598488693652L;

	@Id
	@GeneratedValue (strategy = GenerationType.TABLE)
	@Column (name = "ID", updatable = false, nullable = false)
	private Integer id;
	
	@Column (name = "NAME", length = 50, nullable = false)
	private String name;
	
	@Column (name = "VORNAME", length = 30)
	private String vorname;
	
	@Column (name = "GEBURTSTAG")
	private Date geburtstag;
	
	@Column (name = "GEBURTSORT", length = 50)
	private String geburtsort;
	
	@OneToOne (fetch = FetchType.LAZY)
	@JoinColumn (name = "LAND_ID")
	private Land land;
	
	@OneToOne (fetch = FetchType.LAZY)
	@JoinColumn (name = "STAATSBUERGERSCHAFT_ID")
	private Land staatsbuergerschaft;
	
	public Integer getAlter() {
		return 0;
	}
	
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getVorname() {
		return vorname;
	}

	public void setVorname(String vorname) {
		this.vorname = vorname;
	}

	public Date getGeburtstag() {
		return geburtstag;
	}

	public void setGeburtstag(Date geburtstag) {
		this.geburtstag = geburtstag;
	}

	public String getGeburtsort() {
		return geburtsort;
	}

	public void setGeburtsort(String geburtsort) {
		this.geburtsort = geburtsort;
	}

	public Land getLand() {
		return land;
	}

	public void setLand(Land land) {
		this.land = land;
	}

	public Land getStaatsbuergerschaft() {
		return staatsbuergerschaft;
	}

	public void setStaatsbuergerschaft(Land staatsbuergerschaft) {
		this.staatsbuergerschaft = staatsbuergerschaft;
	}
	
}
